package com.hbnu.service;

import com.hbnu.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class UserService {

    //@Autowired
    @Resource(name = "userDao")
    private UserDao userDao;

    public void setUserDao(UserDao userDao){
        this.userDao = userDao;
    }

    public void addUser(){
        //System.out.println("add user by userService...");
        userDao.addUser();
    }

    public void account(){
        userDao.lessMoney();

        int i = 1 / 0;

        userDao.moreMoney();
    }
}


